/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2024/8/30
 * Time: 17:01
 */

#ifndef SERVER_H
#define SERVER_H

#include <Content.pb.h>
#include <map>
#include <mutex>
#include <zmq.hpp>

class Server
{
public:
     Server();
    ~Server() = default;

    void Run();

private:
    zmq::context_t context_;
    zmq::socket_t  snapshot_;
    zmq::socket_t  publisher_;
    zmq::socket_t  collector_;

    std::mutex mutex_;
    int32_t    sequence_ {0};

    std::map<int32_t, Chat::Internal::SingleMessage> all_messages_;
};

#endif//SERVER_H
